package com.yanqu.road.server.manager.activity.chuhan.task.impl;

import com.yanqu.road.entity.enums.eTongBingTaskType;
import com.yanqu.road.server.manager.activity.chuhan.activity.CrossChuHanActivity;
import com.yanqu.road.server.manager.activity.chuhan.task.BaseCrossChuHanTask;
import com.yanqu.road.utils.date.DateHelper;

/**
 * 每3秒检查要同步的
 */
public class CrossChuHanAlwaysSyncTask extends BaseCrossChuHanTask {

    public CrossChuHanAlwaysSyncTask(CrossChuHanActivity activity, long beginTime) {
        super(activity, beginTime);
    }

    @Override
    public void runTask() {
        activity.syncBuffToAll();
        activity.syncOrderCityTaskToAll();
        if (DateHelper.getCurrentTime()/1000 < activity.getConfig().getActivityInfo().getEndTime()) {//活动结束了就不要跑任务了
            activity.addTask(new CrossChuHanAlwaysSyncTask(activity, System.currentTimeMillis() + 3 * DateHelper.SECOND_MILLIONS));
        }
    }

    @Override
    public String getId() {
        return generateId();
    }

    @Override
    public eTongBingTaskType getType() {
        return eTongBingTaskType.NpcEvent;
    }

    public static String generateId() {
        return "";
    }
}
